\documentclass[xcolor={usenames,svgnames}]{beamer}

\usepackage[francais]{babel}
\usepackage{rtxslides}
\usepackage{listings}
\usepackage{tikz}
\usetikzlibrary{shapes,fit}

\newcommand{\bgcolor}{black}
\newcommand{\fgcolor}{white}

\lstdefinelanguage{rathaxes}%
{
	morekeywords={
        interface, extend,                      % interfaces : decl
        device, configuration, driver,          % devices
        with, values,                           % backend+interface
        builtin, provided, required, optional,  % interfaces: implem
        type, sequence, variable,               % general: element type
        pointcut, chunk,                        % for aspectual concepts
        template                                % backend
    },%
	morecomment=[l][\color{Gainsboro}]{//},%
 	morecomment=[l][\color{Gainsboro}]{\#},%
	morecomment=[s][\color{Gainsboro}]{/*}{*/},%
	morestring=[b][\color{Gold}]",%
	morestring=[b][\color{Gold}]',%
	keywordstyle={\color{Tomato}}%
}[keywords,comments,strings]

\lstset{
    language=rathaxes,
    tabsize=4,
    captionpos=b,
    emptylines=0,
    breaklines=false,
    breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace
    extendedchars=false,
    showstringspaces=false,
    showspaces=false,
    numbersep=1ex,
    showtabs=false,
    basicstyle=\color{white}\scriptsize\ttfamily,
    numberstyle=\color{Gainsboro}\scriptsize\ttfamily,
    stepnumber=1,                   % the step between two line-numbers. If it's 1, each line
    keywordstyle=\color{Tomato},
    commentstyle=\color{Gainsboro},
    stringstyle=\color{white},
    backgroundcolor=\color{black},
    escapeinside={\%*}{*)},         % if you want to add a comment within your code
    morekeywords={*,...}            % if you want to add more keywords to the set
}

\title{\rtx\ -- Final Technical Defense}
\date{13 janvier 2012}
\author{\rtx\ 2012 \\ \texttt{www.rathaxes.org}}

\definecolor{lightred}{RGB}{147,36,33}
\newcommand{\cemph}[1]{{\itshape\LARGE{\textcolor{rathaxesred}{#1}}}}

\setbeamertemplate{navigation symbols}{}

\tikzset{textbox/.style={draw, ultra thick, color=rathaxesred, rectangle, text=\fgcolor, rounded corners=3pt}}
\tikzset{warrow/.style={->, >=stealth, color=\fgcolor, ultra thick}}
\tikzset{graybox/.style={draw,rectangle,rounded corners=3pt,very thick,densely dashed,color=gray!75,text=\fgcolor}}
\tikzset{redcontainer/.style={draw,rectangle,rounded corners=5pt,ultra thick,color=rathaxesred,text=white,minimum height=3.5cm,minimum width=2.5cm}}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\rmfamily{\itshape{«~\rtx\ est un \textcolor{rathaxesred}{langage dédié} qui
permet d'\textcolor{rathaxesred}{écrire des pilotes} de périphériques. \rtx\
compile vers des modules noyaux écrits en C pour n'importe quel système
d'exploitation implémenté.~»}}
\end{frame}

\begin{frame}{Origine du projet}
\Large{
\begin{itemize}
\item \rtx\ 2009 ;
\item Améliorer le développement de pilotes ;
\item Thèse de L. Reveillere \emph{«~Devil~»} (2002).
\end{itemize}
}
\end{frame}

\begin{frame}{Problématiques}
\Large{
\begin{itemize}
\item Compétences multiples ;
\item Code critique ; % non seulement en terme de fiabilité mais aussi en terme de debug
\item « Réutilisabilité » du code. % à la fois en terme de portabilité mais aussi en interne il y a beaucoup de répétitions.
\end{itemize}
}
\end{frame}

\begin{frame}{Solution proposée en 2009}
\Large{
\begin{itemize}
\item Séparer les compétences ;
\item Rendre le code réutilisable ;
\end{itemize}
\begin{center}
\uncover<2->{\vspace{1em}{\LARGE \emph{Permettre à différente personnes d'écrire différente parties du pilote.}}}
\end{center}
}
\end{frame}

\begin{frame}{Implémentation proposée en 2009}
\Large{
\begin{itemize}
% notez la subtilité entre DSL qui permet de décrire un pilote et DSL qui
% permet d'écrire un pilote.
\item DSL pour décrire un pilote ;
\item Et son compilateur (écrit en CodeWorker) :
\end{itemize}
}
\begin{center}
\begin{tikzpicture}
%\draw (0, 0) node {$\bullet$};

\node[textbox, minimum height=20mm] (desc) at (-2.5, 0) {\begin{minipage}{30mm}
\begin{center}
Description \\ \texttt{.rtx}
\end{center}
\end{minipage}};

\node[textbox,minimum height=20mm] (back) at (2.5, 0) {\begin{minipage}{30mm}
\begin{center}
Backend \\ Library \\ \texttt{.cwt}
\end{center}
\end{minipage}};
\node[textbox,text=\fgcolor] (Compiler) at (0, -2.15) {Compilateur};

\node (C) at (0, -3.85) {\includegraphics[height=15mm]{icons/c}};

%\draw[color=DodgerBlue,ultra thick, dashed] (Compiler.north west) -- (back.south west);
\draw[warrow] (desc) -- (Compiler);
\draw[warrow] (back) -- (Compiler);
\draw[warrow] (Compiler) -- (C);
\end{tikzpicture}
\end{center}
\end{frame}

\begin{frame}{Limitations de \rtx\ 2009}
\Large{
\begin{itemize}
% notez la subtilité entre DSL qui permet de décrire un pilote et DSL qui
% permet d'écrire un pilote.
\item Le DSL ne permet pas d'écrire tout le pilote ;
\item Partie de chaque pilote dans le compilateur :
\end{itemize}
}
\begin{center}
\begin{tikzpicture}
%\draw (0, 0) node {$\bullet$};

\node[textbox, minimum height=20mm] (desc) at (-2.5, 0) {\begin{minipage}{30mm}
\begin{center}
Description \\ \texttt{.rtx}
\end{center}
\end{minipage}};

\node[textbox,minimum height=20mm,color=DodgerBlue,dashed] (back) at (2.5, 0) {\begin{minipage}{30mm}
\begin{center}
Backend \\ Library \\ \texttt{.cwt}
\end{center}
\end{minipage}};
\node[textbox,color=DodgerBlue, dashed,text=\fgcolor] (Compiler) at (0, -2.15) {Compilateur};

\node (C) at (0, -3.85) {\includegraphics[height=15mm]{icons/c}};

%\draw[color=DodgerBlue,ultra thick, dashed] (Compiler.north west) -- (back.south west);
\draw[warrow] (desc) -- (Compiler);
\draw[warrow] (back) -- (Compiler);
\draw[warrow] (Compiler) -- (C);
\end{tikzpicture}
\end{center}
\end{frame}

\begin{frame}{\rtx\ 2012}
\Large{
\begin{itemize}
\item Reprise du concept de DSL \& Compilateur ;
\item Reprise d'une partie du Front-end (\texttt{.rtx}) ;
\item Élargissement du langage ;
\item Nouveau modèle de génération.
\end{itemize}
}
\end{frame}

\begin{frame}{Nouvelles composantes du langage}
\begin{center}
\tikzset{textbox/.style={draw, ultra thick, color=rathaxesred, minimum height=5cm, rectangle, rounded corners=3pt, fill=lightred, text=\fgcolor}}
\begin{tikzpicture}
%\draw (-4, 1.5) node[above, text width=2cm, text centered, rotate=45]{\small{Développeur de pilotes}} ;
\node[textbox] (frontend) at (-4, 1.5) {\begin{minipage}{25mm}
\begin{center}
Description \\ \texttt{(.rtx)}
\end{center}
\end{minipage}} ;
\draw (-2.65, -1.5) node (title) {\cemph{Langage Rathaxes}} ;

%\draw (0, 1.5) node[above, text width=2cm, text centered, rotate=45]{\textcolor{black}{\small{Développeur Rathaxes}}} ;
\node[textbox] (middleend) at (0, 1.5) {\begin{minipage}{25mm}
\begin{center}
Interfaces \\ \texttt{(.rti)}
\end{center}
\end{minipage}} ;

%\draw (4, 1.5) node[above, text width=2cm, text centered, rotate=45]{\textcolor{black}{\small{Développeur systèmes}}} ;
\node[textbox] (backend) at (4, 1.5) {\begin{minipage}{25mm}
\begin{center}
Patrons de code \\ \texttt{(.blt)}
\end{center}
\end{minipage}} ;
\node[draw] (box) [ultra thick, dashed, color=rathaxesred, rounded corners=3pt, fit = (frontend) (middleend) (backend) (title)] {} ;
\end{tikzpicture}
\end{center}
\end{frame}

\begin{frame}[fragile]{Génération du code}
\begin{tikzpicture}[overlay]
\node (RTX) at (2,2.5) {\includegraphics[height=1.5cm]{icons/rtx}};
\draw (RTX.north east) node[below right]{\large{Description du pilote}};

\node (C) at (2,-3.5) {\includegraphics[height=1.5cm]{icons/c}};

\node[graybox] (AST1) at (2,0.5){\texttt{AST}};
\draw[warrow] (RTX)--(AST1);

\node[graybox] (AST2) at (2,-1.5) {\texttt{AST}};
\draw[warrow] (AST2)--(C);

\node[redcontainer] (COMPILER) at (2,-0.5) {};
\draw (COMPILER.south east) node[above right]{\Large{Compilateur}};

\node[graybox] (RTXLINK) at (COMPILER.center) {\texttt{RTX\_Link}};
\draw[warrow] (AST1)--(RTXLINK);
\draw[warrow] (RTXLINK)--(AST2);

\node (RTI) at (4.5,0.85) {\includegraphics[height=1.3cm]{icons/rti}};
\draw (RTI.east) node[above right]{\Large{Interfaces}};
\draw[warrow] (RTI.west)--(RTXLINK.north);

\node (BLT) at (4.5,-0.5) {\includegraphics[height=1.3cm]{icons/blt}};
\draw (BLT.east) node[above right]{\Large{Patrons de code}};
\draw[warrow] (BLT.west)--(RTXLINK);
\draw (C.north east) node [below right]{\large{Module noyau}};
\end{tikzpicture}
\end{frame}

\begin{frame}[fragile]{Génération du code}
\begin{tikzpicture}[overlay]
\node (RTX) at (1.2,2.0) {\includegraphics[height=1.5cm]{icons/rtx}};
\draw (RTX.north east) node[below right]{%
\begin{minipage}{10cm}
Description du pilote :
\begin{itemize}
\item Description du matériel ;
\item Algorithmes ;
\item Paramètres de configuration.
\end{itemize}
\end{minipage}};

\node (RTI) at (1.2,-0.6) {\includegraphics[height=1.5cm]{icons/rti}};
\draw (RTI.north east) node[below right]{%
\begin{minipage}{10cm}
Décrivent un \emph{«~sous système~»} avec :
\begin{itemize}
\item Des types ;
\item Des séquences ;
\item Des variables de configuration.
\end{itemize}
\end{minipage}};

\node (BLT) at (1.2,-3.2) {\includegraphics[height=1.5cm]{icons/blt}};
\draw (BLT.north east) node[below right]{%
\begin{minipage}{10cm}
Implémentations des interfaces pour chaque OS :
\begin{itemize}
\item Templates de types ;
\item Templates de séquences ;
\item Chunks (\emph{« Unités »}) de code.
\end{itemize}
\end{minipage}};
\end{tikzpicture}
\end{frame}

\lstset{numbers=left}

\begin{frame}[fragile]{Génération du code}
\begin{tikzpicture}[overlay]
\node (RTX) at (1.2,2.0) {\includegraphics[height=1.5cm]{icons/rtx}};
\draw (RTX.east) node[right]{%
\begin{minipage}{85mm}
\begin{lstlisting}
device LKM use LKM {
    LKM::init() {
        Log::info("Hello this is LKM");
    }
} /* … */
configuration {
    LKM::name = "hello";
}
\end{lstlisting}
\end{minipage}};

\node (RTI) at (1.2,-0.6) {\includegraphics[height=1.5cm]{icons/rti}};

\draw (RTI.east) node[right]{%
\begin{minipage}{85mm}
\begin{lstlisting}
interface LKM {
    provided pointcut   LKM::includes;
    /* … */
    required sequence   LKM::init() {
        provided chunk      LKM::includes;
        provided chunk      LKM::code; /* … */
\end{lstlisting}
\end{minipage}};

\node (BLT) at (1.2,-3.2) {\includegraphics[height=1.5cm]{icons/blt}};

\draw (BLT.east) node[right]{%
\begin{minipage}{85mm}
\begin{lstlisting}
with LKM {
    ${pointcut LKM::includes};
    template sequence   LKM::init() {
        chunk   LKM::includes() {
            /* #includes */
        }
        chunk   LKM::code() {
            /* Instrumented C code */
        } /* … */
\end{lstlisting}
\end{minipage}};
\draw [ultra thick, rounded corners=3pt, color=DodgerBlue] (3.47,-0.94) rectangle (9.3,-1.3);
\draw [ultra thick, color=DodgerBlue, ->, >=stealth] (5.5,-1.3) -- (3.7,-2);
\draw [ultra thick, color=DodgerBlue, ->, >=stealth] (7.5,-1.3) -- (4.7,-3);

\draw [ultra thick, rounded corners=3pt, color=LimeGreen] (2.70,-0.93) rectangle (8.5,-0.6);
\draw [ultra thick, color=LimeGreen, ->, >=stealth] (6.80,-0.6) -- (3.1,2.7);
\draw [ultra thick, color=LimeGreen, ->, >=stealth] (6.80,-0.95) -- (7.45,-2.45);

\draw [ultra thick, rounded corners=3pt, color=MediumOrchid] (3.5,2.7) rectangle (8.9,2.3);
\draw [ultra thick, color=MediumOrchid, ->, >=stealth] (8.9,2.4) to[bend left] (8.5,-4);
\end{tikzpicture}
\end{frame}

\begin{frame}{Génération du code}
\begin{tikzpicture}[overlay]
\node (RTX) at (1.2,2.0) {\includegraphics[height=1.5cm]{icons/rtx}};
\draw (RTX.east) node[right]{\LARGE{Arbre d'\emph{« advices »}}};

\node (RTI) at (1.2,-0.6) {\includegraphics[height=1.5cm]{icons/rti}};

\draw (RTI.east) node[right]{\LARGE{\emph{« Abstraction »} du backend}};

\node (BLT) at (1.2,-3.2) {\includegraphics[height=1.5cm]{icons/blt}};

\draw (BLT.east) node[right]{\LARGE{Arbre de \emph{« pointcuts »}}};
\end{tikzpicture}
\end{frame}

\begin{frame}{Objectifs atteints}
\large{
\begin{itemize}
\item Passage en Open Source ;
\item Nouvelle version du langage et du compilateur ;
\item Génération de modules sous Linux et Windows ;
\item Pilote Linux PCI/Ethernet pour une carte Intel.
\end{itemize}
}
\end{frame}

\begin{frame}{Merci}
\begin{center}
\Huge{\emph{Questions ?}}
\end{center}

\vspace{2em}
\begin{itemize}
\item \Large{\texttt{http://www.rathaxes.org/}}
\end{itemize}
\end{frame}

\setbeamertemplate{footline}{}

\begin{frame}[fragile]
\begin{center}
\begin{tikzpicture}[overlay]
\node (RTX) at (-1,0.5) {\includegraphics[height=60mm]{logo_latex}};

\draw (0, -3.3) node {{\Huge\itshape{\textcolor{rathaxesred}{\rtx}}}};

\draw (5.3, -4.6) node {\includegraphics[height=7mm]{logo_eip}};

\draw (3.5, -4.6) node {\includegraphics[height=7mm]{logo_epitech}};
\end{tikzpicture}
\end{center}
\end{frame}

\end{document}
